import { Injectable } from '@angular/core';

import { Observable } from 'rxjs';

import { HttpRequestService } from '../../core/services/http-request.service';

@Injectable()
export class UserService {
    constructor(private httpRequestService: HttpRequestService) { }

    create(data: any): Observable<any> {
        return this.httpRequestService.post<any>('/foo/create', data);
    }

    getConstant(constantCode: Object): Observable<any> {
        return this.httpRequestService.getWithoutBaseUrl<any>('assets/user-demo-data/user-constant.json');
        // return this.httpRequestService.get<any>('/user/getConstant', constantCode);
    }

    getEchartsNationalityData(constantCode: Object): Observable<any> {
        return this.httpRequestService.getWithoutBaseUrl<any>('assets/user-demo-data/chart-bar-data.json');
        // return this.httpRequestService.get<any>('/user/getEchartsData', constantCode);
    }

    getEchartsStatusData(constantCode: Object): Observable<any> {
        return this.httpRequestService.getWithoutBaseUrl<any>('assets/user-demo-data/chart-pie-data.json');
        // return this.httpRequestService.get<any>('/user/getEchartsData', constantCode);
    }

    getEchartsTreeData(): Observable<any> {
        return this.httpRequestService.getWithoutBaseUrl<any>('assets/user-demo-data/chart-tree-data.json');
    }

    getUserList(searchData: any): Observable<any> {
        return this.httpRequestService.getWithoutBaseUrl<any>('assets/user-demo-data/user-list.json');
        // return this.httpRequestService.get<any>('/user/getUserList', searchData);
    }

    getUserDeatilInfo(userCode: any): Observable<any> {
        return this.httpRequestService.getWithoutBaseUrl<any>('assets/user-demo-data/user-detail.json');
        // return this.httpRequestService.get<any>('/user/getUserDeatilInfo', userCode);
    }

    getUserEditInfo(userCode: any): Observable<any> {
        return this.httpRequestService.getWithoutBaseUrl<any>('assets/user-demo-data/user-edit.json');
        // return this.httpRequestService.get<any>('/user/getUserEditInfo', userCode);
    }

    operateSchedule(data: any): Observable<any> {
        return this.httpRequestService.post<any>('/user/operateSchedule', data);
    }

    save(data: any): Observable<any> {
        return this.httpRequestService.post<any>('/user/save', data);
    }

    showSchedule(data: any): Observable<any> {
        return this.httpRequestService.getWithoutBaseUrl<any>('assets/user-demo-data/user-schedule.json');
        // return this.httpRequestService.get<any>('/user/showSchedule', data);
    }

    getMatchedStatus(data: any): Observable<any> {
        return this.httpRequestService.getWithoutBaseUrl<any>('assets/user-demo-data/status.json');
    }
}